export const hotTrendOptions = (options) => ({
  color: ['#1764CE'],
  tooltip: {
    trigger: 'axis',
  },
  toolbox: {
    show: true,
    right: '10%',
    feature: {
      saveAsImage: {},
    },
  },
  xAxis: {
    type: 'category',
    boundaryGap: false,
    data: options.xData,
  },
  yAxis: {
    type: 'value',
  },
  series: [
    {
      name: '点击量',
      data: options.data,
      type: 'line',
    },
  ],
})

export const mediaContributionOptions = (options) => ({
  tooltip: {
    trigger: 'item',
  },
  legend: {
    top: '5%',
    left: 'center',
  },
  series: [
    {
      name: '点击量',
      type: 'pie',
      radius: ['40%', '70%'],
      avoidLabelOverlap: false,
      itemStyle: {
        borderRadius: 16,
        borderWidth: 4,
        borderColor: '#fff',
      },
      label: {
        show: false,
        position: 'center',
      },
      emphasis: {
        label: {
          show: true,
          fontSize: 20,
          // fontWeight: 'bold',
        },
      },
      labelLine: {
        show: false,
      },
      data: options.data,
      selectedMode: 'single' // 选中模式，这里设置为单选
    },
  ],
})

export const spreadTrendOptions = (options) => ({
  grid: {
    left: '6%'
  },
  legend: {
    bottom: '20',
    icon: 'circle'
  },
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'line',
      lineStyle: { type: 'solid' },
    },
  },
  xAxis: {
    type: 'category',
    data: options.xData,
    boundaryGap: false,
  },
  yAxis: [
    {
      name: '转载数/篇次',
      type: 'value',
    },
    {
      name: '阅读量/篇次',
      // alignTicks: true,
      type: 'value',
    },
  ],
  series: [
    {
      name: '转载数',
      data: options.reshipData,
      type: 'line',
      smooth: true,
      color: '#1764ce',
    },
    {
      name: '阅读量',
      yAxisIndex: 1,
      data: options.readData,
      type: 'line',
      smooth: true,
      color: '#de3f07',
    },
  ],
})
